/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package slicktest.types;

import java.util.EnumMap;

/**
 *
 * @author enrightt
 */
public enum ArmorType {

    NONE(new EnumMap<DamageType, Double>(DamageType.class)),
    
    CLOTH(new EnumMap<DamageType, Double>(DamageType.class) {
        {
            put(DamageType.PIERCING, 2.0D);
            put(DamageType.INCENDIARY, 1.5D);
            put(DamageType.MAGIC, 1.5D);
        }
    }),

    CHAIN_MAIL(new EnumMap<DamageType, Double>(DamageType.class) {
        {
            put(DamageType.PIERCING, .90D);
            put(DamageType.CRUSHING, 1.1D);
            put(DamageType.MAGIC, 1.5D);
        }
    }),

    PLATE_MAIL(new EnumMap<DamageType, Double>(DamageType.class) {
        {
            put(DamageType.PIERCING, .50D);
            put(DamageType.MAGIC, 1.5D);
        }
    }),

    SHIELD_WALL(new EnumMap<DamageType, Double>(DamageType.class) {
        {
            put(DamageType.PIERCING, .25D);
            put(DamageType.INCENDIARY, .80D);
            put(DamageType.MAGIC, 1.5D);
        }
    }),

    MECHANICAL(new EnumMap<DamageType, Double>(DamageType.class) {
        {
            put(DamageType.INCENDIARY, 2.0D);
        }
    });
    private final EnumMap<DamageType, Double> damageModifiers;

    ArmorType(EnumMap<DamageType, Double> damageModifiers) {
        this.damageModifiers = damageModifiers;

    }

    public double getModifier(DamageType damage) {
        Double result = damageModifiers.get(damage);
        
        if(result == null) {
            result = 1D;
        }

        return result;
    }
}
